package com.demo.entity;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;

/**
 * (UserTest)表实体类
 *
 * @author codor
 * @since 2023-10-09 16:25:33
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class UserTest implements Serializable {

    private static final long serialVersionUID = 838769201947622947L;

    @TableId(value = "id", type = IdType.AUTO)
    Integer id;

    String num;

    String name;

    String note;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    LocalDateTime createTime;

    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    LocalDateTime updateTime;

    @JsonIgnore
    LocalDateTime deleteTime;

    public UserTest(String num, String name, String note) {
        this.num = num;
        this.name = name;
        this.note = note;
    }
}
